<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <title>{$activity_info['jsonstr']['pageTitle']}</title>
    <link rel="stylesheet" type="text/css" href="{$Think.config.RESOURCEURL}wx_assets/luckydraw/css/index.css{$Think.config.RESOURCE_VER}" />
    <script src="{$Think.config.RESOURCEURL}wx_assets/luckydraw/js/remApp.js" type="text/javascript" charset="utf-8"></script>
   
    <script src="{$Think.config.RESOURCEURL}wx_assets/js/zepto.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="{$Think.config.RESOURCEURL}wx_assets/js/layer.m.js" type="text/javascript" charset="utf-8"></script>
    <script src="{$Think.config.RESOURCEURL}wx_assets/js/common.js{$Think.config.RESOURCE_VER}" type="text/javascript" charset="utf-8"></script>
    <script src="{$Think.config.RESOURCEURL}wx_assets/js/util.js" type="text/javascript" charset="utf-8"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script src="{$Think.config.RESOURCEURL}wx_assets/womenday/js/wx_share.js{$Think.config.RESOURCE_VER}" type="text/javascript" charset="utf-8"></script>
</head>
<style>
    .luckydrawContainer
    {
        background: url({$activity_info.jsonstr.luckydrawBackground.src}) no-repeat;
        background-size:cover;
        background-position: 50% 50%;
    }
</style>
<script type="text/javascript">
    var actId=$.util.getParamByObject("actId"),
    chanelId=$.util.getParamByObject("chanelId"),
    partake_id="{$record_info.partakeId}",
    customerId=$.util.getParam("customerId"),
    fromUserId=$.util.getParam("fromUserId"),
    fromUserIdstr=fromUserId?"&fromUserId="+fromUserId:"",
    params={actId:actId,chanelId:(chanelId?chanelId:""),partake_id:partake_id?partake_id:""},
    geturl=function(method,bool){
        if(!method)method="index";
        if(bool&&!fromUserId)
        fromUserIdstr="&fromUserId={$userId?$userId:$record_info['userId']}";
        return "call.html?module=luckydraw&method="+method+fromUserIdstr+"&customerId="+customerId+"&params="+encodeURIComponent(JSON.stringify(params))
    },
    sharelink=geturl("index",1);
</script>
<script type="text/javascript">
    //是否抽中
    var type="{$record_info.item_info.type}";
    var code="{$code}"
</script>
<body>
<div class="luckydrawContainer">
<div class="bigbg">
    <img src="{$record_info['item_info']['big_icon']}" alt="" >
    <if condition="$record_info['item_info']['type'] neq '4'">
        <img src="{$activity_info.jsonstr.receiveSuccessBackground.src}" alt="">
        <a class="handlebtn" href="javascript:;">
            <img src="{$activity_info.jsonstr.receiveSuccessBtn.src}" alt="">
        </a>
    <else />
        <img src="{$activity_info.jsonstr.receiveFailBackground.src}" alt="">
        <a class="handlebtn" href="javascript:;">
            <img src="{$activity_info.jsonstr.receiveFailBtn.src}" alt="">
        </a>
    </if>
</div>
</div>
</body>
<script src="{$Think.config.RESOURCEURL}wx_assets/luckydraw/js/index.js{$Think.config.RESOURCE_VER}" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
var receiveFailUrl="{$activity_info.jsonstr.receiveFailUrl}",
    receiveSuccessUrl="{$activity_info.jsonstr.receiveSuccessUrl}";
var baseUrl = '{$Think.config.SERVER_HOST}';
var shareData = {
        "title": "{$activity_info.title}",
        "desc": "{$activity_info.description}",
        "link": baseUrl+sharelink,
        "imgUrl": "{$activity_info.picurl}",
        "pkg": {
            "appId": '{$pkg.appId}',
            "timestamp": {$pkg['timestamp']?$pkg['timestamp']:'""'},
            "nonceStr": '{$pkg.nonceStr}',
            "signature": '{$pkg.signature}'
        }
    }
$(function() {
    wx_share.init(shareData);

    $(".handlebtn").on("click",function(){
        if(type === '4')
        window.location.href=receiveFailUrl;
        else
        window.location.href=receiveSuccessUrl;
    })
})
</script>

</html>
